﻿// Copyright © Microsoft Corporation.  All Rights Reserved.
// This code released under the terms of the 
// Microsoft Public License (MS-PL, http://opensource.org/licenses/ms-pl.html.)

using System.IO.IsolatedStorage;
using System.ComponentModel;
using Bubbles;

namespace Bubbles
{
    public class Settings
    {
        private static int _dimensionX = 12;
        public static int DimensionX
        {
            get 
            { 
                return Settings._dimensionX; 
            }
            set { Settings._dimensionX = value; }
        }

        private static int _dimensionY = 12;
        public static int DimensionY
        {
            get { return Settings._dimensionY; }
            set { Settings._dimensionY = value; }
        }

        private static int _margin = 1;
        public static int Margin
        {
            get { return Settings._margin; }
            set { Settings._margin = value; }
        }

        private static GameLevel _level = GameLevel.Easy;
        public static GameLevel Level
        {
            get 
            {
                return _level; 
            }
            set
            {
                switch (value)
                {
                    case GameLevel.Easy:
                        DimensionX = 6;
                        DimensionY = 6;
                        break;

                    case GameLevel.Hard:
                        DimensionX = 20;
                        DimensionY = 20;
                        break;

                    case GameLevel.Normal:
                    default:
                        DimensionX = 12;
                        DimensionY = 12;
                        break;
                        
                }
                _level = value;
                //IsolatedStorageSettings.ApplicationSettings["GameLevel"] = value;
            }
        }

        

    }
}
